package com.ruoyi.system.service.impl;

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SeatimageMapper;
import com.ruoyi.system.domain.SeatImage;
import com.ruoyi.system.service.ISeatimageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 坐席图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-21
 */
@Service
public class SeatimageServiceImpl implements ISeatimageService 
{
    @Autowired
    private SeatimageMapper seatimageMapper;

    /**
     * 查询坐席图片
     * 
     * @param imagePath 坐席图片主键
     * @return 坐席图片
     */
    @Override
    public SeatImage selectSeatimageByImagePath(String imagePath)
    {
        return seatimageMapper.selectSeatimageByImagePath(imagePath);
    }

    /**
     * 查询坐席图片列表
     * 
     * @param seatimage 坐席图片
     * @return 坐席图片
     */
    @Override
    public List<SeatImage> selectSeatimageList(SeatImage seatimage)
    {
        return seatimageMapper.selectSeatimageList(seatimage);
    }

    @Override
    public Set<String> getExistingTradeIds(String tableName) {
        return seatimageMapper.selectExistingTradeIds(tableName);
    }

    /**
     * 新增坐席图片
     * 
     * @param seatimage 坐席图片
     * @return 结果
     */
    @Override
    public int insertSeatimage(SeatImage seatimage)
    {
        seatimage.setCreateTime(DateUtils.getNowDate());
        return seatimageMapper.insertSeatimage(seatimage);
    }

    /**
     * 修改坐席图片
     * 
     * @param seatimage 坐席图片
     * @return 结果
     */
    @Override
    public int updateSeatimage(SeatImage seatimage)
    {
        seatimage.setUpdateTime(DateUtils.getNowDate());
        return seatimageMapper.updateSeatimage(seatimage);
    }

    /**
     * 批量删除坐席图片
     * 
     * @param imagePaths 需要删除的坐席图片主键
     * @return 结果
     */
    @Override
    public int deleteSeatimageByImagePaths(String imagePaths)
    {
        return seatimageMapper.deleteSeatimageByImagePaths(Convert.toStrArray(imagePaths));
    }

    /**
     * 删除坐席图片信息
     * 
     * @param imagePath 坐席图片主键
     * @return 结果
     */
    @Override
    public int deleteSeatimageByImagePath(String imagePath)
    {
        return seatimageMapper.deleteSeatimageByImagePath(imagePath);
    }
}
